<!DOCTYPE html>
<html>
<head>
    <title>Ceadeal 后台管理系统</title>
    <#include "../common/head.ftl"/>
    <link href="/js/sitelogo/sitelogo.css" rel="stylesheet">
</head>
<body class="cw-body">
<div id="page-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            用户管理
            <small>&nbsp;</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/main"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active">用户管理</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <!-- Your Page Content Here -->
        <ul class="nav nav-tabs">
            <li role="presentation"><a href="/user/list">列表</a></li>
            <li role="presentation"><a href="/user/edit">新增</a></li>
            <li role="presentation" class="active"><a href="#">查看</a></li>
            <!-- /... -->
        </ul>

        <form id="form1" name="form1" method="post">
        <div class="row">
            <div class="col-md-6">
                <!-- box 1 -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><i class="fa fa-info-circle"></i>&nbsp;基本信息</h3>
                        <div class="box-tools pull-right">
                            <button type="button" id="btn_edit" class="btn btn-warning btn-xs btn-xs-custom"><i class="fa fa-pencil"></i></button>&emsp;
                            <button type="button" id="btn_back" class="btn btn-default btn-xs btn-xs-custom"><i class="fa fa-arrow-left"></i></button>&emsp;
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                        </div>
                    </div>
                    <div class="box-body">
                        <table id="infoTable" class="table table-bordered table-striped table-info">
                            <tr>
                                <td style="width:25%;">用户名：</td>
                                <td>${(user.userName)!}</td>
                            </tr>
                            <tr>
                                <td>密码：</td>
                                <td>******</td>
                            </tr>
                            <tr>
                                <td>昵称：</td>
                                <td>${(user.nickName)!}</td>
                            </tr>
                            <tr>
                                <td>手机号：</td>
                                <td>${((user.mobile)?length>0)?string(user.mobile, "--")}</td>
                            </tr>
                            <tr>
                                <td>邮箱：</td>
                                <td>${((user.email)?length>0)?string(user.email, "--")}</td>
                            </tr>
                            <tr>
                                <td>等级：</td>
                                <td>${(user.level)!}</td>
                            </tr>
                        </table>
                    </div>
                    <div class="box-footer with-border">
                        <button type="button" id="btn_back_two" class="btn btn-default btn-control"><i class="fa fa-arrow-left"></i>&nbsp;返&nbsp;回</button>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <!-- box 2 -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><i class="fa fa-picture-o"></i>&nbsp;头像</h3>
                        <div class="box-tools pull-right">
                            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                        </div>
                    </div>
                    <div class="box-body">
                        <div class="ibox-content">
                            <div class="row">
                                <div id="crop-avatar" class="col-md-6">
                                    <div class="avatar-view" style="border-radius: 50%;">
                                        <img id="img-avatar" src="${user.avatar!''}" alt="头像">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </form>
    </section>
    <!-- /.content -->
</div>

<!-- REQUIRED JS SCRIPTS -->
<#include "../common/script-common.ftl"/>
<!-- jQuery validate -->
<script>
    $(function(){
        $("#btn_edit").click(function() {
            location.href = "/user/edit?id=${user.id}";
        });
        $("#btn_back,#btn_back_two").click(function(){
            location.href = "/user/list";
        });
    });
</script>
</body>
</html>